<?php

printf('<div class="user-details">');

$this->renderPartial('//common/user_one', array(
	'user' => $model,
	'small_icons' => false,
	'image_width' => 240,
	'image_height' => 240,
	'show_notification' => true,
	'show_friendship' => true,
	'num_rewards' => 0,
)); 

printf('</div>');

if ( $model->user_id == user()->id || $model->privacy == 'public' || ($model->privacy == 'friend' && $model->isFriend(user()->id)) ) :

?>

<section class="block">
	<h2 class="block-title">Your Friends List <?php echo $model->friendCount ? sprintf('(%d)', $model->friendCount) : '' ?>
		<?php if ( $model->user_id == user()->id && $model->friendCount ) : ?>
			&nbsp;&nbsp;&nbsp;<?php printf('<a style="vertical-align: middle; font-size: 11px; color: #fff;" class="button button2" href="%s"><i class="icon-plus"></i>+ Find more friends</a>', $this->createUrl('/user/findFriends/')); ?>
		<?php endif; ?>
	</h2>
	
	<div class="block-content">
		<?php if ( $model->friendCount > 0 ) {

			$this->renderPartial('//common/users_list', array(
				'users' => $model->friend,
			));

		} elseif ( $model->user_id == user()->id ) {

			printf('<p style="font-size: 16px;">Do you have Friend ?');
			printf('&nbsp;&nbsp;&nbsp;<a class="button button2" href="%s"><i class="icon-plus"></i>+ Find Friends</a>', $this->createUrl('/user/findFriends/'));
			printf('</p>');

		}
		
		?>
		
	</div>
</section> 

<?php endif; ?> 